Crash when key in snap/keys is not ascii armored
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
If I put a key in snap/keys/ that is not ascii armored (ie. it's a binary file), snapcraft crashes with:
Sorry, an error occurred in Snapcraft:
'utf-8' codec can't decode byte 0x98 in position 0: invalid start byte
This is with --enable-experimental-package-repositories and:
package-repositories:
- type: apt
url: file:///home/ubuntu/repo
path: .
key-id: EE2C5601BCD68938A8A04B9FE257B677BFDF724C
and a file called snap/keys/EE2C5601.asc.
Expected: a suitable error message. Actual: a crash.
Solution: gpg -a --export BFDF724C > snap/keys/EE2C5601.asc
In other words, ensure that the file is actually ASCII. The workaround is easy, but there's an opportunity for better handling of this; hence this report.
Evaluation history
No evaluation history available.